Skip to contentSkip to conversation

Change in openvpn[master]: Make dh none behaviour default if not specific and add dh auto

Openvpn-devel In review plaisthos (Code Review) 2 participants 18 messages Apr 23, 2025 – May 19, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1745405723000.Ica02244c9f0ac9b4690a51f940fda9d900465289@...2715...

#1 lore raw

Attention is currently required from: flichtenheld.

Hello flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/945?usp=email

to review the following change.

Change subject: Make dh none behaviour default if not specific and add dh auto
......................................................................

Make dh none behaviour default if not specific and add dh auto

Nowadays ciphers that are using still DH and not ECDH are rarely chosen as best cipher suite. Our man page even indicates that OpenSSL 1.0.1+ supports ECDH cipher suites. So it does not feel useful to force specifying --dh anymore.

Custom generated Diffie Hellmann parameters are also discouraged nowadays. The newest OpenSSL FIPS libraries even flat out reject them:

FIPS 186-4 type domain parameters no longer allowed in FIPS mode, since the required validation routines were removed from FIPS 186-5

So add --dh auto since is very little extra code to let the TLS library itself pick the parameter.

Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
---
M Changes.rst
M doc/man-sections/tls-options.rst
M src/openvpn/options.c
M src/openvpn/ssl.c
M src/openvpn/ssl_backend.h
M src/openvpn/ssl_mbedtls.c
M src/openvpn/ssl_openssl.c

7 files changed, 53 insertions(+), 9 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/945/1

Changes.rst +6 -0
index a4f5e57..a7ce8f8 100644
@@ -103,6 +103,12 @@
 - ``--x509-username-field`` will no longer automatically convert fieldnames to
   uppercase. This is deprecated since OpenVPN 2.4, and has now been removed.
 
+- ``--dh none`` is now the default if ``--dh`` is specified. Modern TLS
+  implementations will prefer ECDH and other more modern algorithm anyway.
+
+- ``--dh auto`` instructs the TLS library - if supported - to use internal
+  Diffie-Hellmann parameters.
+
 Overview of changes in 2.6
 ==========================
 
doc/man-sections/tls-options.rst +12 -6
index 0638d09..d5ebf52 100644
@@ -171,16 +171,22 @@
 
 
 --dh file
-  File containing Diffie Hellman parameters in .pem format (required for
+  File containing Diffie Hellman parameters in .pem format (used by
   ``--tls-server`` only).
 
   Set ``file`` to :code:`none` to disable Diffie Hellman key exchange (and
-  use ECDH only). Note that this requires peers to be using an SSL library
-  that supports ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or
-  mbed TLS 2.0+).
+  use ECDH or newer hybrid key agreement algorithms like X25519MLKEM768).
+  Note that this requires peers to be using an SSL library that supports
+  ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or mbed TLS 2.0+). Starting
+  with 2.7.0, this is the same as not specifying ``--dh`` at all.
 
-  Use ``openssl dhparam -out dh2048.pem 2048`` to generate 2048-bit DH
-  parameters. Diffie Hellman parameters may be considered public.
+  Set ``file`` to :code:`auto` enables using builtin Diffie Hellman
+  parameters of the TLS library, e.g. the ones defined in RFC 7919.
+
+  Diffie Hellman parameters can be generated using
+  ``openssl dhparam -out dh2048.pem 2048`` but it is recommended to
+  use the public well-known parameter or using ``none``.
+  Diffie Hellman parameters may be considered public.
 
 --ecdh-curve name
   Specify the curve to use for elliptic curve Diffie Hellman. Available
src/openvpn/options.c +6 -2
index 96119c4..2979872 100644
@@ -3711,8 +3711,12 @@
 
     if (o->tls_server)
     {
-        /* Check that DH file is specified, or explicitly disabled */
-        notnull(o->dh_file, "DH file (--dh)");
+        if (streq(o->dh_file, "auto"))
+        {
+            o->dh_file = "auto";
+            /* do not check existence of the "auto" file */
+            o->dh_file_inline = true;
+        }
         if (streq(o->dh_file, "none"))
         {
             o->dh_file = NULL;
src/openvpn/ssl.c +5 -1
index 23f6423..d591bac 100644
@@ -535,7 +535,11 @@
     {
         tls_ctx_server_new(new_ctx);
 
-        if (options->dh_file)
+        if (options->dh_file && !strcmp(options->dh_file, "auto"))
+        {
+            tls_ctx_use_dh_params_builtin(new_ctx);
+        }
+        else if  (options->dh_file)
         {
             tls_ctx_load_dh_params(new_ctx, options->dh_file,
                                    options->dh_file_inline);
src/openvpn/ssl_backend.h +7 -0
index e25727f..326f78d 100644
@@ -223,6 +223,13 @@
                             bool dh_file_inline);
 
 /**
+ * Instructs the TLS library to use builtin Diffie Hellman Parameters instead
+ * of loading specific ones (e.g. the ones from RFC 7919)
+ * @param ctx
+ */
+void tls_ctx_use_dh_params_builtin(struct tls_root_ctx *ctx);
+
+/**
  * Load Elliptic Curve Parameters, and load them into the library-specific
  * TLS context.
  *
src/openvpn/ssl_mbedtls.c +7 -0
index e15c391..f1fada3 100644
@@ -480,6 +480,13 @@
 }
 
 void
+tls_ctx_use_dh_params_builtin(struct tls_root_ctx *ctx)
+{
+    msg(M_FATAL, "mbed TLS does not support --dh auto. Use --dh none or "
+        "manually specify Diffie-Hellmann parameters");
+}
+
+void
 tls_ctx_load_ecdh_params(struct tls_root_ctx *ctx, const char *curve_name
                          )
 {
src/openvpn/ssl_openssl.c +10 -0
index f7be50c..f204007 100644
@@ -714,6 +714,16 @@
 }
 
 void
+tls_ctx_use_dh_params_builtin(struct tls_root_ctx *ctx)
+{
+    if (!SSL_CTX_set_dh_auto(ctx->ctx, 1))
+    {
+        crypto_msg(M_FATAL, "SSL_CTX_set_dh_auto");
+    }
+
+}
+
+void
 tls_ctx_load_ecdh_params(struct tls_root_ctx *ctx, const char *curve_name)
 {
 #if OPENSSL_VERSION_NUMBER >= 0x30000000L

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

Change subject: Make dh none behaviour default if not specific and add dh auto
......................................................................

Patch Set 1: Code-Review-1

(4 comments)

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/e1153c4e_50db37a0 :
PS1, Line 7: Make dh none behaviour default if not specific and add dh auto Do you mean "specified" instead of "specific"?

File doc/man-sections/tls-options.rst:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/b9aff705_92f37f5f :
PS1, Line 183: Set ``file`` to :code:auto enables using builtin Diffie Hellman
"Setting"

http://gerrit.openvpn.net/c/openvpn/+/945/comment/7b830145_762c2aad :
PS1, Line 188: use the public well-known parameter or using ``none``.
"parameters"

File src/openvpn/options.c:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/c4fa3ce2_91eeefc1 :
PS1, Line 3716: o->dh_file = "auto";
It is already "auto", so this seems redundant.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Wed, 23 Apr 2025 11:06:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

[Openvpn-devel] [M] Change in openvpn[master]: Make dh none behaviour default if not specified and add dh auto

In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

Hello flichtenheld,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/945?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Code-Review-1 by flichtenheld

Change subject: Make dh none behaviour default if not specified and add dh auto
......................................................................

Make dh none behaviour default if not specified and add dh auto

Nowadays ciphers that are using still DH and not ECDH are rarely chosen as best cipher suite. Our man page even indicates that OpenSSL 1.0.1+ supports ECDH cipher suites. So it does not feel useful to force specifying --dh anymore.

Custom generated Diffie Hellmann parameters are also discouraged nowadays. The newest OpenSSL FIPS libraries even flat out reject them:

FIPS 186-4 type domain parameters no longer allowed in FIPS mode, since the required validation routines were removed from FIPS 186-5

So add --dh auto since is very little extra code to let the TLS library itself pick the parameter.

Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
---
M Changes.rst
M doc/man-sections/tls-options.rst
M src/openvpn/options.c
M src/openvpn/ssl.c
M src/openvpn/ssl_backend.h
M src/openvpn/ssl_mbedtls.c
M src/openvpn/ssl_openssl.c

7 files changed, 53 insertions(+), 10 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/945/2

Changes.rst +6 -0
index a4f5e57..a7ce8f8 100644
@@ -103,6 +103,12 @@
 - ``--x509-username-field`` will no longer automatically convert fieldnames to
   uppercase. This is deprecated since OpenVPN 2.4, and has now been removed.
 
+- ``--dh none`` is now the default if ``--dh`` is specified. Modern TLS
+  implementations will prefer ECDH and other more modern algorithm anyway.
+
+- ``--dh auto`` instructs the TLS library - if supported - to use internal
+  Diffie-Hellmann parameters.
+
 Overview of changes in 2.6
 ==========================
 
doc/man-sections/tls-options.rst +12 -6
index 0638d09..ad4c9cc 100644
@@ -171,16 +171,22 @@
 
 
 --dh file
-  File containing Diffie Hellman parameters in .pem format (required for
+  File containing Diffie Hellman parameters in .pem format (used by
   ``--tls-server`` only).
 
   Set ``file`` to :code:`none` to disable Diffie Hellman key exchange (and
-  use ECDH only). Note that this requires peers to be using an SSL library
-  that supports ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or
-  mbed TLS 2.0+).
+  use ECDH or newer hybrid key agreement algorithms like X25519MLKEM768).
+  Note that this requires peers to be using an SSL library that supports
+  ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or mbed TLS 2.0+). Starting
+  with 2.7.0, this is the same as not specifying ``--dh`` at all.
 
-  Use ``openssl dhparam -out dh2048.pem 2048`` to generate 2048-bit DH
-  parameters. Diffie Hellman parameters may be considered public.
+  Set ``file`` to :code:`auto` to enable builtin Diffie Hellman
+  parameters of the TLS library, e.g. the ones defined in RFC 7919.
+
+  Diffie Hellman parameters can be generated using
+  ``openssl dhparam -out dh2048.pem 2048`` but it is recommended to
+  use the public well-known parameters or using ``none``.
+  Diffie Hellman parameters may be considered public.
 
 --ecdh-curve name
   Specify the curve to use for elliptic curve Diffie Hellman. Available
src/openvpn/options.c +6 -3
index 96119c4..e67371e 100644
@@ -3711,9 +3711,12 @@
 
     if (o->tls_server)
     {
-        /* Check that DH file is specified, or explicitly disabled */
-        notnull(o->dh_file, "DH file (--dh)");
-        if (streq(o->dh_file, "none"))
+        if (streq(o->dh_file, "auto"))
+        {
+            /* do not check existence of the "auto" file */
+            o->dh_file_inline = true;
+        }
+        else if (streq(o->dh_file, "none"))
         {
             o->dh_file = NULL;
         }
src/openvpn/ssl.c +5 -1
index 23f6423..d591bac 100644
@@ -535,7 +535,11 @@
     {
         tls_ctx_server_new(new_ctx);
 
-        if (options->dh_file)
+        if (options->dh_file && !strcmp(options->dh_file, "auto"))
+        {
+            tls_ctx_use_dh_params_builtin(new_ctx);
+        }
+        else if  (options->dh_file)
         {
             tls_ctx_load_dh_params(new_ctx, options->dh_file,
                                    options->dh_file_inline);
src/openvpn/ssl_backend.h +7 -0
index e25727f..326f78d 100644
@@ -223,6 +223,13 @@
                             bool dh_file_inline);
 
 /**
+ * Instructs the TLS library to use builtin Diffie Hellman Parameters instead
+ * of loading specific ones (e.g. the ones from RFC 7919)
+ * @param ctx
+ */
+void tls_ctx_use_dh_params_builtin(struct tls_root_ctx *ctx);
+
+/**
  * Load Elliptic Curve Parameters, and load them into the library-specific
  * TLS context.
  *
src/openvpn/ssl_mbedtls.c +7 -0
index e15c391..f1fada3 100644
@@ -480,6 +480,13 @@
 }
 
 void
+tls_ctx_use_dh_params_builtin(struct tls_root_ctx *ctx)
+{
+    msg(M_FATAL, "mbed TLS does not support --dh auto. Use --dh none or "
+        "manually specify Diffie-Hellmann parameters");
+}
+
+void
 tls_ctx_load_ecdh_params(struct tls_root_ctx *ctx, const char *curve_name
                          )
 {
src/openvpn/ssl_openssl.c +10 -0
index f7be50c..f204007 100644
@@ -714,6 +714,16 @@
 }
 
 void
+tls_ctx_use_dh_params_builtin(struct tls_root_ctx *ctx)
+{
+    if (!SSL_CTX_set_dh_auto(ctx->ctx, 1))
+    {
+        crypto_msg(M_FATAL, "SSL_CTX_set_dh_auto");
+    }
+
+}
+
+void
 tls_ctx_load_ecdh_params(struct tls_root_ctx *ctx, const char *curve_name)
 {
 #if OPENSSL_VERSION_NUMBER >= 0x30000000L

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset

#4 lore raw

[Openvpn-devel] [M] Change in openvpn[master]: Make dh none behaviour default if not specified and add dh auto

In reply to a message not in the archive

Attention is currently required from: flichtenheld.

plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

Change subject: Make dh none behaviour default if not specified and add dh auto
......................................................................

Patch Set 2:

(2 comments)

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/52d0bfdd_9f13c56b :
PS1, Line 7: Make dh none behaviour default if not specific and add dh auto

Quoted 1 line

Do you mean "specified" instead of "specific"?

Done

File src/openvpn/options.c:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/1c0a6e2f_dfb427ff :
PS1, Line 3716: o->dh_file = "auto";

Quoted 1 line

It is already "auto", so this seems redundant.

Done

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 24 Apr 2025 11:20:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]...>
Gerrit-MessageType: comment

#5 lore raw

[Openvpn-devel] [M] Change in openvpn[master]: Make dh none behaviour default if not specified and add dh auto

In reply to a message not in the archive

Attention is currently required from: plaisthos.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

Change subject: Make dh none behaviour default if not specified and add dh auto
......................................................................

Patch Set 2: Code-Review-1

(6 comments)

Patchset:

PS2:
Some more nitpicking

File doc/man-sections/tls-options.rst:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/0875d49b_2e79eee5 :
PS1, Line 183: Set ``file`` to :code:auto enables using builtin Diffie Hellman

Quoted 1 line

"Setting"

Done

http://gerrit.openvpn.net/c/openvpn/+/945/comment/24f9ab7c_0d7f8e5e :
PS1, Line 188: use the public well-known parameter or using ``none``.

Quoted 1 line

"parameters"

Done

File doc/man-sections/tls-options.rst:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/46dda9bc_dd7a8286 :
PS2, Line 179: Note that this requires peers to be using an SSL library that supports
"to use" instead of "to be using". While not incorrect I think it sounds clunky.

http://gerrit.openvpn.net/c/openvpn/+/945/comment/ff6311bb_0efb9609 :
PS2, Line 188: use the public well-known parameters or using ``none``.
"use" versus "using". Maybe just remove the "using"?

File src/openvpn/ssl.c:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/3cee585a_d672dc5f :
PS2, Line 538: if (options->dh_file && !strcmp(options->dh_file, "auto"))
Any reason not to use streq() here like in options.c?

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Fri, 25 Apr 2025 11:39:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: flichtenheld <[email protected]...>
Gerrit-MessageType: comment

#6 lore raw

[Openvpn-devel] [M] Change in openvpn[master]: Make dh none behaviour default if not specified and add dh auto

In reply to a message not in the archive

plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

Change subject: Make dh none behaviour default if not specified and add dh auto
......................................................................

Patch Set 2: Code-Review-2

(1 comment)

Patchset:

PS2:
After a bit more consideration, I think we should just not bother with auto and just do dh none as default. They are already forbidden to use by BSI TR-02102-4 by 2029 and IETF also deprecates them (https://datatracker.ietf.org/doc/draft-ietf-tls-deprecate-obsolete-kex/).

So I will update the patch to provide only dh none as default.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Comment-Date: Tue, 29 Apr 2025 21:04:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#7 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Make --dh none behaviour default if not specified

In reply to a message not in the archive

Attention is currently required from: flichtenheld.

Hello flichtenheld,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/945?usp=email

to look at the new patch set (#3).

The following approvals got outdated and were removed:
Code-Review-1 by flichtenheld

Change subject: Make --dh none behaviour default if not specified
......................................................................

Make --dh none behaviour default if not specified

Nowadays ciphers that are using still DH and not ECDH are rarely chosen as best cipher suite. Our man page even indicates that OpenSSL 1.0.1+ supports ECDH cipher suites. So it does not feel useful to force specifying --dh anymore.

Side note: Custom generated Diffie Hellmann parameters are also discouraged nowadays. The newest OpenSSL FIPS libraries even flat out reject them:

FIPS 186-4 type domain parameters no longer allowed in FIPS mode, since the required validation routines were removed from FIPS 186-5

But instead of adding support for loading the well-known curve just make dh none the default and the recommended option as finite field Diffie Hellmann is being deprecated anyway
(https://datatracker.ietf.org/doc/draft-ietf-tls-deprecate-obsolete-kex/)
and not supported by TLS 1.3 at all.

Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
---
M Changes.rst
M doc/man-sections/tls-options.rst
M src/openvpn/options.c

3 files changed, 17 insertions(+), 9 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/945/3

Changes.rst +5 -0
index a4f5e57..0b0bbeb 100644
@@ -103,6 +103,11 @@
 - ``--x509-username-field`` will no longer automatically convert fieldnames to
   uppercase. This is deprecated since OpenVPN 2.4, and has now been removed.
 
+- ``--dh none`` is now the default if ``--dh`` is specified. Modern TLS
+  implementations will prefer ECDH and other more modern algorithm anyway.
+  And finite field Diffie Hellman is in the proces of being deprecated
+  (see draft-ietf-tls-deprecate-obsolete-kex)
+
 Overview of changes in 2.6
 ==========================
 
doc/man-sections/tls-options.rst +12 -7
index 0638d09..1ce6424 100644
@@ -171,16 +171,21 @@
 
 
 --dh file
-  File containing Diffie Hellman parameters in .pem format (required for
-  ``--tls-server`` only).
+  File containing finite field Diffie Hellman parameters in .pem format (used
+  by ``--tls-server`` only).
 
   Set ``file`` to :code:`none` to disable Diffie Hellman key exchange (and
-  use ECDH only). Note that this requires peers to be using an SSL library
-  that supports ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or
-  mbed TLS 2.0+).
+  use ECDH or newer hybrid key agreement algorithms like X25519MLKEM768).
+  Note that this requires peers to be using an SSL library that supports
+  ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or mbed TLS 2.0+). Starting
+  with 2.7.0, this is the same as not specifying ``--dh`` at all.
 
-  Use ``openssl dhparam -out dh2048.pem 2048`` to generate 2048-bit DH
-  parameters. Diffie Hellman parameters may be considered public.
+  Diffie Hellman parameters can be generated using
+  ``openssl dhparam -out dh2048.pem 2048`` but it is recommended to
+  use ``none`` as finite field Diffie Hellman have been replaced
+  by more modern variants like ECDH.
+
+  Diffie Hellman parameters may be considered public.
 
 --ecdh-curve name
   Specify the curve to use for elliptic curve Diffie Hellman. Available
src/openvpn/options.c +0 -2
index 96119c4..f84d5f3 100644
@@ -3711,8 +3711,6 @@
 
     if (o->tls_server)
     {
-        /* Check that DH file is specified, or explicitly disabled */
-        notnull(o->dh_file, "DH file (--dh)");
         if (streq(o->dh_file, "none"))
         {
             o->dh_file = NULL;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 3
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset

#8 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Make --dh none behaviour default if not specified

In reply to a message not in the archive

Attention is currently required from: flichtenheld.

plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

Change subject: Make --dh none behaviour default if not specified
......................................................................

Patch Set 3: -Code-Review

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 3
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 02 May 2025 12:54:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#9 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Make --dh none behaviour default if not specified

In reply to a message not in the archive

Attention is currently required from: plaisthos.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

Change subject: Make --dh none behaviour default if not specified
......................................................................

Patch Set 3:

(1 comment)

File doc/man-sections/tls-options.rst:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/bd4cea1f_e64df6d1 :
PS2, Line 188: use the public well-known parameters or using ``none``.

Quoted 1 line

"use" versus "using". […]

Done

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 3
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Fri, 02 May 2025 14:22:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]...>
Gerrit-MessageType: comment

#10 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Make --dh none behaviour default if not specified

In reply to a message not in the archive

Attention is currently required from: plaisthos.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

Change subject: Make --dh none behaviour default if not specified
......................................................................

Patch Set 3:

(1 comment)

File src/openvpn/ssl.c:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/a5c405c1_29bf9aa8 :
PS2, Line 538: if (options->dh_file && !strcmp(options->dh_file, "auto"))

Quoted 1 line

Any reason not to use streq() here like in options. […]

Done

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 3
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Fri, 02 May 2025 14:23:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]...>
Gerrit-MessageType: comment

#11 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Make --dh none behaviour default if not specified

In reply to a message not in the archive

Attention is currently required from: plaisthos.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

Change subject: Make --dh none behaviour default if not specified
......................................................................

Patch Set 3: Code-Review-1

(2 comments)

Patchset:

PS3:
text in Changes.rst

File Changes.rst:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/d1d9e939_7100d9fb :
PS3, Line 107: implementations will prefer ECDH and other more modern algorithm anyway.
this line seems to be missing a "not" - if --dh is not specified. No?

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 3
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Mon, 05 May 2025 10:43:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#12 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Make --dh none behaviour default if not specified

In reply to a message not in the archive

Attention is currently required from: cron2, flichtenheld.

plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

Change subject: Make --dh none behaviour default if not specified
......................................................................

Patch Set 3:

(2 comments)

File Changes.rst:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/35ce90c4_aeef4068 :
PS3, Line 107: implementations will prefer ECDH and other more modern algorithm anyway.

Quoted 1 line

this line seems to be missing a "not" - if --dh is not specified. […]

Acknowledged

File doc/man-sections/tls-options.rst:

http://gerrit.openvpn.net/c/openvpn/+/945/comment/502502c9_e7a23051 :
PS2, Line 179: Note that this requires peers to be using an SSL library that supports

Quoted 1 line

"to use" instead of "to be using". While not incorrect I think it sounds clunky.

Acknowledged

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 3
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Sun, 18 May 2025 20:43:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>
Comment-In-Reply-To: flichtenheld <[email protected]...>
Gerrit-MessageType: comment

#13 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Make --dh none behaviour default if not specified

In reply to a message not in the archive

Attention is currently required from: cron2, flichtenheld.

Hello cron2, flichtenheld,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/945?usp=email

to look at the new patch set (#4).

The following approvals got outdated and were removed:
Code-Review-1 by cron2

Change subject: Make --dh none behaviour default if not specified
......................................................................

Make --dh none behaviour default if not specified

Nowadays ciphers that are using still DH and not ECDH are rarely chosen as best cipher suite. Our man page even indicates that OpenSSL 1.0.1+ supports ECDH cipher suites. So it does not feel useful to force specifying --dh anymore.

Side note: Custom generated Diffie Hellmann parameters are also discouraged nowadays. The newest OpenSSL FIPS libraries even flat out reject them:

FIPS 186-4 type domain parameters no longer allowed in FIPS mode, since the required validation routines were removed from FIPS 186-5

But instead of adding support for loading the well-known curve just make dh none the default and the recommended option as finite field Diffie Hellmann is being deprecated anyway
(https://datatracker.ietf.org/doc/draft-ietf-tls-deprecate-obsolete-kex/)
and not supported by TLS 1.3 at all.

Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
---
M Changes.rst
M doc/man-sections/tls-options.rst
M src/openvpn/options.c

3 files changed, 19 insertions(+), 10 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/945/4

Changes.rst +5 -0
index a4f5e57..e297334 100644
@@ -103,6 +103,11 @@
 - ``--x509-username-field`` will no longer automatically convert fieldnames to
   uppercase. This is deprecated since OpenVPN 2.4, and has now been removed.
 
+- ``--dh none`` is now the default if ``--dh`` is not specified. Modern TLS
+  implementations will prefer ECDH and other more modern algorithms anyway.
+  And finite field Diffie Hellman is in the proces of being deprecated
+  (see draft-ietf-tls-deprecate-obsolete-kex)
+
 Overview of changes in 2.6
 ==========================
 
doc/man-sections/tls-options.rst +14 -8
index 0638d09..012518b 100644
@@ -171,16 +171,22 @@
 
 
 --dh file
-  File containing Diffie Hellman parameters in .pem format (required for
-  ``--tls-server`` only).
+  File containing finite field Diffie Hellman parameters in .pem format (used
+  by ``--tls-server`` only).
 
-  Set ``file`` to :code:`none` to disable Diffie Hellman key exchange (and
-  use ECDH only). Note that this requires peers to be using an SSL library
-  that supports ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or
-  mbed TLS 2.0+).
+  Setting``file`` to :code:`none` to disable fine field Diffie Hellman
+  key exchange (and to only use ECDH or newer hybrid key agreement algorithms
+  like X25519MLKEM768 instead).
+  Note that this requires peers to be using an SSL library that supports
+  ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or mbed TLS 2.0+). Starting
+  with 2.7.0, this is the same as not specifying ``--dh`` at all.
 
-  Use ``openssl dhparam -out dh2048.pem 2048`` to generate 2048-bit DH
-  parameters. Diffie Hellman parameters may be considered public.
+  Diffie Hellman parameters can be generated using
+  ``openssl dhparam -out dh2048.pem 2048`` but it is recommended to
+  use ``none`` as finite field Diffie Hellman have been replaced
+  by more modern variants like ECDH.
+
+  Diffie Hellman parameters may be considered public.
 
 --ecdh-curve name
   Specify the curve to use for elliptic curve Diffie Hellman. Available
src/openvpn/options.c +0 -2
index 3c1632f..1c7b4bc 100644
@@ -3708,8 +3708,6 @@
 
     if (o->tls_server)
     {
-        /* Check that DH file is specified, or explicitly disabled */
-        notnull(o->dh_file, "DH file (--dh)");
         if (streq(o->dh_file, "none"))
         {
             o->dh_file = NULL;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset

#14 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Make --dh none behaviour default if not specified

In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

Change subject: Make --dh none behaviour default if not specified
......................................................................

Patch Set 4: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Sun, 18 May 2025 22:02:29 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#15 lore raw

PATCH v4 1/1 Make --dh none behaviour default if not specified

In reply to a message not in the archive

From: Arne Schwabe <[email protected]...>

Nowadays ciphers that are using still DH and not ECDH are rarely chosen as best cipher suite. Our man page even indicates that OpenSSL 1.0.1+ supports ECDH cipher suites. So it does not feel useful to force specifying --dh anymore.

Side note: Custom generated Diffie Hellmann parameters are also discouraged nowadays. The newest OpenSSL FIPS libraries even flat out reject them:

FIPS 186-4 type domain parameters no longer allowed in FIPS mode, since the required validation routines were removed from FIPS 186-5

But instead of adding support for loading the well-known curve just make dh none the default and the recommended option as finite field Diffie Hellmann is being deprecated anyway
(https://datatracker.ietf.org/doc/draft-ietf-tls-deprecate-obsolete-kex/)
and not supported by TLS 1.3 at all.

Change-Id Ica02244c9f0ac9b4690a51f940fda9d900465289

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/945
This mail reflects revision 4 of this Change.

Signed-off-by line for the author was added as per our policy.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

Changes.rst +5 -0
index a4f5e57..e297334 100644
@@ -103,6 +103,11 @@
 - ``--x509-username-field`` will no longer automatically convert fieldnames to
   uppercase. This is deprecated since OpenVPN 2.4, and has now been removed.
 
+- ``--dh none`` is now the default if ``--dh`` is not specified. Modern TLS
+  implementations will prefer ECDH and other more modern algorithms anyway.
+  And finite field Diffie Hellman is in the proces of being deprecated
+  (see draft-ietf-tls-deprecate-obsolete-kex)
+
 Overview of changes in 2.6
 ==========================
 
doc/man-sections/tls-options.rst +14 -8
index 0638d09..012518b 100644
@@ -171,16 +171,22 @@
 
 
 --dh file
-  File containing Diffie Hellman parameters in .pem format (required for
-  ``--tls-server`` only).
+  File containing finite field Diffie Hellman parameters in .pem format (used
+  by ``--tls-server`` only).
 
-  Set ``file`` to :code:`none` to disable Diffie Hellman key exchange (and
-  use ECDH only). Note that this requires peers to be using an SSL library
-  that supports ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or
-  mbed TLS 2.0+).
+  Setting``file`` to :code:`none` to disable fine field Diffie Hellman
+  key exchange (and to only use ECDH or newer hybrid key agreement algorithms
+  like X25519MLKEM768 instead).
+  Note that this requires peers to be using an SSL library that supports
+  ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or mbed TLS 2.0+). Starting
+  with 2.7.0, this is the same as not specifying ``--dh`` at all.
 
-  Use ``openssl dhparam -out dh2048.pem 2048`` to generate 2048-bit DH
-  parameters. Diffie Hellman parameters may be considered public.
+  Diffie Hellman parameters can be generated using
+  ``openssl dhparam -out dh2048.pem 2048`` but it is recommended to
+  use ``none`` as finite field Diffie Hellman have been replaced
+  by more modern variants like ECDH.
+
+  Diffie Hellman parameters may be considered public.
 
 --ecdh-curve name
   Specify the curve to use for elliptic curve Diffie Hellman. Available
src/openvpn/options.c +0 -2
index 3c1632f..1c7b4bc 100644
@@ -3708,8 +3708,6 @@
 
     if (o->tls_server)
     {
-        /* Check that DH file is specified, or explicitly disabled */
-        notnull(o->dh_file, "DH file (--dh)");
         if (streq(o->dh_file, "none"))
         {
             o->dh_file = NULL;
#16 lore raw

[Openvpn-devel] [PATCH applied] Re: Make --dh none behaviour default if not specified

This patch doesn't actually change very much, except no longer requiring an explicit "--dh none" for deployments that do not need DH params (like, everything recent). So this is mostly documentation and a very small code change ("none" maps to "dh_file = NULL", and not setting anything defaults to "dh_file = NULL", just the check "something MUST be set!!!" is removed).

Your patch has been applied to the master branch.

commit 57bdefbabd8d48fa93216c2049663fa3cacc50d3

Author: Arne Schwabe
Date:   Mon May 19 00:02:39 2025 +0200
     Make --dh none behaviour default if not specified

     Signed-off-by: Arne Schwabe <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg31695.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#17 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Make --dh none behaviour default if not specified

In reply to a message not in the archive

cron2 has uploaded a new patch set (#5) to the change originally created by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: Make --dh none behaviour default if not specified
......................................................................

Make --dh none behaviour default if not specified

Nowadays ciphers that are using still DH and not ECDH are rarely chosen as best cipher suite. Our man page even indicates that OpenSSL 1.0.1+ supports ECDH cipher suites. So it does not feel useful to force specifying --dh anymore.

Side note: Custom generated Diffie Hellmann parameters are also discouraged nowadays. The newest OpenSSL FIPS libraries even flat out reject them:

FIPS 186-4 type domain parameters no longer allowed in FIPS mode, since the required validation routines were removed from FIPS 186-5

But instead of adding support for loading the well-known curve just make dh none the default and the recommended option as finite field Diffie Hellmann is being deprecated anyway
(https://datatracker.ietf.org/doc/draft-ietf-tls-deprecate-obsolete-kex/)
and not supported by TLS 1.3 at all.

Change-Id Ica02244c9f0ac9b4690a51f940fda9d900465289

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg31695.html

---
M Changes.rst
M doc/man-sections/tls-options.rst
M src/openvpn/options.c

3 files changed, 19 insertions(+), 10 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/945/5

Changes.rst +5 -0
index a4f5e57..e297334 100644
@@ -103,6 +103,11 @@
 - ``--x509-username-field`` will no longer automatically convert fieldnames to
   uppercase. This is deprecated since OpenVPN 2.4, and has now been removed.
 
+- ``--dh none`` is now the default if ``--dh`` is not specified. Modern TLS
+  implementations will prefer ECDH and other more modern algorithms anyway.
+  And finite field Diffie Hellman is in the proces of being deprecated
+  (see draft-ietf-tls-deprecate-obsolete-kex)
+
 Overview of changes in 2.6
 ==========================
 
doc/man-sections/tls-options.rst +14 -8
index 0638d09..db107e6 100644
@@ -171,16 +171,22 @@
 
 
 --dh file
-  File containing Diffie Hellman parameters in .pem format (required for
-  ``--tls-server`` only).
+  File containing finite field Diffie Hellman parameters in .pem format (used
+  by ``--tls-server`` only).
 
-  Set ``file`` to :code:`none` to disable Diffie Hellman key exchange (and
-  use ECDH only). Note that this requires peers to be using an SSL library
-  that supports ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or
-  mbed TLS 2.0+).
+  Set ``file`` to :code:`none` to disable fine field Diffie Hellman
+  key exchange (and to only use ECDH or newer hybrid key agreement algorithms
+  like X25519MLKEM768 instead).
+  Note that this requires peers to be using an SSL library that supports
+  ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or mbed TLS 2.0+). Starting
+  with 2.7.0, this is the same as not specifying ``--dh`` at all.
 
-  Use ``openssl dhparam -out dh2048.pem 2048`` to generate 2048-bit DH
-  parameters. Diffie Hellman parameters may be considered public.
+  Diffie Hellman parameters can be generated using
+  ``openssl dhparam -out dh2048.pem 2048`` but it is recommended to
+  use ``none`` as finite field Diffie Hellman have been replaced
+  by more modern variants like ECDH.
+
+  Diffie Hellman parameters may be considered public.
 
 --ecdh-curve name
   Specify the curve to use for elliptic curve Diffie Hellman. Available
src/openvpn/options.c +0 -2
index 810bb56..6672b5c 100644
@@ -3703,8 +3703,6 @@
 
     if (o->tls_server)
     {
-        /* Check that DH file is specified, or explicitly disabled */
-        notnull(o->dh_file, "DH file (--dh)");
         if (streq(o->dh_file, "none"))
         {
             o->dh_file = NULL;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 5
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#18 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Make --dh none behaviour default if not specified

In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/945?usp=email )

Change subject: Make --dh none behaviour default if not specified
......................................................................

Make --dh none behaviour default if not specified

Nowadays ciphers that are using still DH and not ECDH are rarely chosen as best cipher suite. Our man page even indicates that OpenSSL 1.0.1+ supports ECDH cipher suites. So it does not feel useful to force specifying --dh anymore.

Side note: Custom generated Diffie Hellmann parameters are also discouraged nowadays. The newest OpenSSL FIPS libraries even flat out reject them:

FIPS 186-4 type domain parameters no longer allowed in FIPS mode, since the required validation routines were removed from FIPS 186-5

But instead of adding support for loading the well-known curve just make dh none the default and the recommended option as finite field Diffie Hellmann is being deprecated anyway
(https://datatracker.ietf.org/doc/draft-ietf-tls-deprecate-obsolete-kex/)
and not supported by TLS 1.3 at all.

Change-Id Ica02244c9f0ac9b4690a51f940fda9d900465289

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg31695.html

---
M Changes.rst
M doc/man-sections/tls-options.rst
M src/openvpn/options.c

3 files changed, 19 insertions(+), 10 deletions(-)
Changes.rst +5 -0
index a4f5e57..e297334 100644
@@ -103,6 +103,11 @@
 - ``--x509-username-field`` will no longer automatically convert fieldnames to
   uppercase. This is deprecated since OpenVPN 2.4, and has now been removed.
 
+- ``--dh none`` is now the default if ``--dh`` is not specified. Modern TLS
+  implementations will prefer ECDH and other more modern algorithms anyway.
+  And finite field Diffie Hellman is in the proces of being deprecated
+  (see draft-ietf-tls-deprecate-obsolete-kex)
+
 Overview of changes in 2.6
 ==========================
 
doc/man-sections/tls-options.rst +14 -8
index 0638d09..db107e6 100644
@@ -171,16 +171,22 @@
 
 
 --dh file
-  File containing Diffie Hellman parameters in .pem format (required for
-  ``--tls-server`` only).
+  File containing finite field Diffie Hellman parameters in .pem format (used
+  by ``--tls-server`` only).
 
-  Set ``file`` to :code:`none` to disable Diffie Hellman key exchange (and
-  use ECDH only). Note that this requires peers to be using an SSL library
-  that supports ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or
-  mbed TLS 2.0+).
+  Set ``file`` to :code:`none` to disable fine field Diffie Hellman
+  key exchange (and to only use ECDH or newer hybrid key agreement algorithms
+  like X25519MLKEM768 instead).
+  Note that this requires peers to be using an SSL library that supports
+  ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or mbed TLS 2.0+). Starting
+  with 2.7.0, this is the same as not specifying ``--dh`` at all.
 
-  Use ``openssl dhparam -out dh2048.pem 2048`` to generate 2048-bit DH
-  parameters. Diffie Hellman parameters may be considered public.
+  Diffie Hellman parameters can be generated using
+  ``openssl dhparam -out dh2048.pem 2048`` but it is recommended to
+  use ``none`` as finite field Diffie Hellman have been replaced
+  by more modern variants like ECDH.
+
+  Diffie Hellman parameters may be considered public.
 
 --ecdh-curve name
   Specify the curve to use for elliptic curve Diffie Hellman. Available
src/openvpn/options.c +0 -2
index 810bb56..6672b5c 100644
@@ -3703,8 +3703,6 @@
 
     if (o->tls_server)
     {
-        /* Check that DH file is specified, or explicitly disabled */
-        notnull(o->dh_file, "DH file (--dh)");
         if (streq(o->dh_file, "none"))
         {
             o->dh_file = NULL;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 5
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged